package com.lzy.fabric.worldgen.mineral;

import com.lzy.fabric.blocks.ModBlocks;
import net.minecraft.init.Blocks;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import net.minecraft.world.chunk.IChunkProvider;
import net.minecraft.world.gen.IChunkGenerator;
import net.minecraftforge.fml.common.IWorldGenerator;

import java.util.Random;

/**
 * @author 测试矿物生成
 */
public class TestMineral implements IWorldGenerator {

    /**
     *
     * @param random 随机数类
     * @param chunkX 区块坐标
     * @param chunkZ 区块坐标
     * @param world 自身世界
     * @param chunkGenerator
     * @param chunkProvider
     */
    @Override
    public void generate(Random random,
                         int chunkX,
                         int chunkZ,
                         World world,
                         IChunkGenerator chunkGenerator,
                         IChunkProvider chunkProvider) {

        //获取基本的坐标原点
        int X = chunkX * 16;
        int Z = chunkZ * 16;

        for (int i = 1; i < 128; i++) {
            world.setBlockState(new BlockPos(X+7,i,Z+7), Blocks.GOLD_BLOCK.getDefaultState());

        }



    }
}
